home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15862 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  939 b 

  1. Path: cpsc.ucalgary.ca!davidt
  2. From: davidt@cpsc.ucalgary.ca (David Taylor)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: G++ math question
  5. Date: 6 Apr 1996 23:49:24 GMT
  6. Organization: University of Calgary CPSC
  7. Message-ID: <4k6vu4$vfh@linux.cpsc.ucalgary.ca>
  8. References: <00001a81+0000b148@msn.com>
  9. NNTP-Posting-Host: hk.cpsc.ucalgary.ca
  10.  
  11. In article <00001a81+0000b148@msn.com>, Roger Marlowe <RMarlowe@msn.com> wrote:
  12. >     I wrote a program on MSVC 4 and I am trying to compile it with G++ 
  13. >in a UNIX envir.
  14. >    G++ doesn't know what 'log()', 'pow()' or 'floor()' are even though 
  15. >I have #included<math.h>.
  16. >
  17. >    Doesn't G++ have math routines or maybe they aren't installed on 
  18. >this particular machine??
  19.  
  20. Make sure you link with the math library.  This is done by putting
  21. "-lm" at the end of the line.  Example:
  22.  
  23.     gcc foo.c -lm
  24.  
  25. -- 
  26. Andrew Taylor     |email: davidt@cpsc.ucalgary.ca
  27.                   |www:   http://www.cpsc.ucalgary.ca/~davidt
  28.